import Layout from '@/layout'
import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import TableButtonType from '@/framework/constant/TableButtonType'
import DateUtil from '@/framework/infra/util/DateUtil'

export default [
  {
    path: '/pdt',
    component: Layout,
    name: 'pdt',
    meta: { title: '商品管理', icon: 'el-icon-s-help' },
    children: [
      // {
      //   path: 'spu',
      //   name: 'pdt-spu',
      //   component: () => import('@/feature/pdt/app/spu/index'),
      //   meta: {title: '商品列表', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-spu').curdoo()
      //     .addCheck().build()
      // }, {
      //   path: 'spu/category',
      //   name: 'pdt-spu-category',
      //   component: () => import('@/feature/pdt/app/spu/category'),
      //   meta: {title: '发布新商品', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-spu-category').curdoo()
      //     .addCheck().build()
      // }, {
      //   path: 'spu/edit',
      //   name: 'pdt-spu-edit',
      //   hidden: true,
      //   component: () => import('@/feature/pdt/app/spu/edit'),
      //   meta: {title: '修改商品', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-spu-edit').curdoo()
      //     .addCheck().build()
      // }, {
      //   path: 'spu/success',
      //   name: 'pdt-spu-success',
      //   hidden: true,
      //   component: () => import('@/feature/pdt/app/spu/success'),
      //   meta: {title: '提交成功', icon: 'table'}
      // },
      // {
      //   path: 'backend-category',
      //   name: 'pdt-backend-category',
      //   component: () => import('@/feature/pdt/app/backend-category/index'),
      //   meta: {title: '后端类目', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-backend-category').r()
      //     .build()
      // },
      // {
      //   path: 'front-category',
      //   name: 'pdt-front-category',
      //   component: () => import('@/feature/pdt/app/front-category/index'),
      //   meta: {title: '前台类目', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-front-category').curdoo()
      //     .build()
      // },
      // {
      //   path: 'brand',
      //   name: 'pdt-brand',
      //   component: () => import('@/feature/pdt/app/brand/index'),
      //   meta: {title: '商品品牌', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-brand').curdoo()
      //     .build()
      // },

      // {
      //   path: 'preference-area',
      //   name: 'pdt-preference-area',
      //   component: () => import('@/feature/pdt/app/preference-area/index'),
      //   meta: {title: '优选专区', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-preference-area').curdoo()
      //     .build()
      // },
      // {
      //   path: 'property',
      //   name: 'pdt-property',
      //   component: () => import('@/feature/pdt/app/property/index'),
      //   meta: {title: '商品属性', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-property').curdoo()
      //     .build()
      // },
      // {
      //   path: 'property-group',
      //   name: 'pdt-property-group',
      //   component: () => import('@/feature/pdt/app/property-group/index'),
      //   meta: {title: '商品属性组', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-property-group').curd()
      //     .build()
      // },
      // {
      //   path: 'property-value',
      //   name: 'pdt-property-value',
      //   component: () => import('@/feature/pdt/app/property-value/index'),
      //   meta: { title: '属性值', icon: 'table' },
      //   buttons: RouteButtonsBuilder.builder('pdt-property-value').curd()
      //     .build()
      // },
      // {
      //   path: 'property-value-group',
      //   name: 'pdt-property-value-group',
      //   component: () => import('@/feature/pdt/app/property-value-group/index'),
      //   meta: { title: '属性值分组', icon: 'table' },
      //   buttons: RouteButtonsBuilder.builder('pdt-property-value-group').curd()
      //     .build()
      // },
      // {
      //   path: 'property-value-relation',
      //   name: 'pdt-property-value-relation',
      //   component: () => import('@/feature/pdt/app/property-value-relation/index'),
      //   meta: { title: '属性和属性值关联表', icon: 'table' },
      //   buttons: RouteButtonsBuilder.builder('pdt-property-value-relation').curd()
      //     .build()
      // },
      // {
      //   path: 'spu-service',
      //   name: 'pdt-spu-service',
      //   component: () => import('@/feature/pdt/app/spu-service/index'),
      //   meta: {title: '商品服务', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt-spu-service').curd()
      //     .build()
      // },
//       {
//         path: 'product',
//         name: 'pdt-product',
//         component: () => import('@/feature/pdt/app/product/index'),
//         meta: { title: '商品', icon: 'table' },
//         buttons: RouteButtonsBuilder.builder('pdt-product').curd()
//           .build()
//       }
//  ,
//       {
//         path: 'product-register',
//         name: 'pdt-product-register',
//         component: () => import('@/feature/pdt/app/product-register/index'),
//         meta: {title: 'ID登记', icon: 'table'},
//         buttons: RouteButtonsBuilder.builder('pdt-product-register').curd()
//           .build()
//       },
      {
        path: 'new-product-register',
        component: () => import('@/feature/pdt/app/new-product-register/index'),
        meta: { title: '上新登记', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:new-product-register')
          .view('list')
          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'list',
              name: 'list',
              groupId: 2,
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'sameSpuCount',
              name: 'list',
              type: TableButtonType.COL,
              icon: 'el-icon-view',
              col: 'sameSpuCount',
              label: '查看',
              showFilter: ({ row }) => {
                return row.sameSpuCount > 1
              },
              buttonType: 'danger'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '选款',
              icon: 'el-icon-plus'
            }, {
              handler: 'batchVideoPick',
              name: 'art-handled',
              type: TableButtonType.TOOLBAR,
              label: '批量领取视频',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }
          ])
          .addButton({
            name: 'chosen',
            label: '上新'
            // showFilter: value => value.status === PdtNewProductRegisterStatusEnum.WAIT_CHOSEN.id
          })
          .addButton({
            name: 'art-handled',
            label: '美工是否已领取',
            showFilter: value => value.artHandled !== 1
          })
          .addButton({
            name: 'art-handled',
            handler: 'cancel-art-handled',
            label: '美工取消已领取',
            showFilter: value => value.artHandled !== 0
          }).addButton({
            name: 'art-handled',
            handler: 'artVideoHandled',
            label: '领取视频',
            showFilter: value => value.videoPickFlag !== 1
          })
          .addButton({
            name: 'art-handled',
            handler: 'cancelArtVideoHandled',
            label: '取消领取视频',
            showFilter: value => value.videoPickFlag !== 0
          })
          .addButton({
            name: 'title',
            label: '取标题'
            // showFilter: value => value.status >= PdtNewProductRegisterStatusEnum.WAIT_DONE.id
          })
          .addButton({
            name: 'modify-title',
            label: '修改标题'
            // showFilter: value => value.status >= PdtNewProductRegisterStatusEnum.WAIT_DONE.id
          })
          .build()
      },
      {
        path: 'new-product-register-data',
        component: () => import('@/feature/pdt/app/new-product-register/data'),
        meta: { title: '上新数据报表', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:new-product-register:data')
          .build()
      },
      {
        path: 'new-product-register-data2',
        component: () => import('@/feature/pdt/app/new-product-register/data2'),
        meta: { title: '店铺上新统计', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:new-product-register:data')
          .build()
      },
      {
        path: 'art-designer-work',
        component: () => import('@/feature/pdt/app/new-product-register/art-designer-work'),
        meta: { title: '美工工作统计', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:new-product-register:data')
          .build()
      },
      {
        path: 'product-log',
        component: () => import('@/feature/pdt/app/product-log/index'),
        meta: { title: '生意参谋', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:product-log').view().curd({ hasName: true })
          .addButton({
            handler: 'import',
            name: 'create',
            type: TableButtonType.TOOLBAR,
            label: '导入',
            buttonType: 'danger',
            icon: 'el-icon-upload'
          }).addButton({
            handler: 'clearAll',
            buttonType: 'danger',
            name: 'batch-remove',
            type: TableButtonType.TOOLBAR,
            label: '批量清理',
            icon: 'el-icon-edit'
          }).build()
      },
      {
        path: 'product-log-data',
        component: () => import('@/feature/pdt/app/product-log/data'),
        meta: { title: '新加访客及加购达标', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:product-log:data')
          .r()
          .build()
      },
      {
        path: 'new-product-register-style-num',
        component: () => import('@/feature/pdt/app/new-product-register-style-num/index'),
        meta: { title: '上新选款总数', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:new-product-register-style-num')
          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建上新选款总数',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }

          ])
          .build()
      },
      {
        path: 'new-product-register-style-num-mine',
        component: () => import('@/feature/pdt/app/new-product-register-style-num/mine'),
        meta: { title: '我的选款总数', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:new-product-register-style-num:mine')
          .addButtons([
            {
              handler: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建上新选款总数',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit',
              showFilter: row => row.styleDate === DateUtil.currentDate()
            }
          ])
          .build()
      },
      {
        path: 'new-product-id-register',
        component: () => import('@/feature/pdt/app/new-product-id-register/index'),
        meta: { title: 'ID登记', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:new-product-id-register')
          .view('list')
          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            }, {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '清除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            },
            {
              handler: 'batch-remove',
              name: 'remove',
              type: TableButtonType.TOOLBAR,
              label: '批量清除',
              buttonType: 'danger'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            // {
            //   handler: 'total-sale-num',
            //   name: 'total-sale-num',
            //   type: TableButtonType.ROW,
            //   label: '修改销量',
            //   icon: 'el-icon-edit'
            // },
            {
              handler: 'batch-daily-act',
              name: 'daily-act',
              type: TableButtonType.TOOLBAR,
              label: '批量日常活动',
              icon: 'el-icon-edit'
            }, {
              name: 'daily-act',
              type: TableButtonType.ROW,
              label: '日常活动',
              icon: 'el-icon-edit'
            }, {
              name: 'black-box',
              type: TableButtonType.ROW,
              label: '小黑盒',
              icon: 'el-icon-edit'
            }, {
              handler: 'batch-black-box',
              name: 'black-box',
              type: TableButtonType.TOOLBAR,
              label: '批量小黑盒',
              icon: 'el-icon-edit'
            },
            {
              name: 'guide-material',
              type: TableButtonType.ROW,
              label: '导购素材',
              icon: 'el-icon-edit'
            }, {
              handler: 'batch-guide-material',
              name: 'guide-material',
              type: TableButtonType.TOOLBAR,
              label: '批量导购素材',
              icon: 'el-icon-edit'
            },
            {
              handler: 'batch-milky-way',
              name: 'milky-way',
              type: TableButtonType.TOOLBAR,
              label: '批量银河',
              icon: 'el-icon-edit'
            }, {
              name: 'milky-way',
              type: TableButtonType.ROW,
              label: '银河',
              icon: 'el-icon-edit'
            }, {
              name: 'micro-detail',
              type: TableButtonType.ROW,
              label: '微详情',
              icon: 'el-icon-edit'
            }, {
              handler: 'batch-micro-detail',
              name: 'micro-detail',
              type: TableButtonType.TOOLBAR,
              label: '批量微详情',
              icon: 'el-icon-edit'
            }, {
              handler: 'batch-combination-purchase',
              name: 'combination-purchase',
              type: TableButtonType.TOOLBAR,
              label: '批量搭配购',
              icon: 'el-icon-edit'
            }, {
              name: 'combination-purchase',
              type: TableButtonType.ROW,
              label: '搭配购',
              icon: 'el-icon-edit'
            }, {
              name: 'search-video',
              handler: 'batch-search-video',
              type: TableButtonType.TOOLBAR,
              label: '批量搜索视频',
              icon: 'el-icon-edit'
            }, {
              name: 'search-video',
              type: TableButtonType.ROW,
              label: '搜索视频',
              icon: 'el-icon-edit'
            }, {
              name: 'subscription',
              handler: 'batch-subscription',
              type: TableButtonType.TOOLBAR,
              label: '批量订阅',
              icon: 'el-icon-edit'
            }, {
              name: 'subscription',
              type: TableButtonType.ROW,
              label: '订阅',
              icon: 'el-icon-edit'
            }, {
              handler: 'batch-guess-like',
              name: 'guess-like',
              type: TableButtonType.TOOLBAR,
              label: '批量猜你喜欢',
              icon: 'el-icon-edit'
            }, {
              name: 'guess-like',
              type: TableButtonType.ROW,
              label: '猜你喜欢',
              icon: 'el-icon-edit'
            }, {
              name: 'price-change',
              type: TableButtonType.ROW,
              label: '改价',
              icon: 'el-icon-edit'
            }, {
              handler: 'batch-price-change',
              name: 'price-change',
              type: TableButtonType.TOOLBAR,
              label: '批量改价',
              icon: 'el-icon-edit'
            }
            // {
            //   name: 'black-box-help',
            //   type: TableButtonType.ROW,
            //   label: '黑盒护航',
            //   icon: 'el-icon-edit'
            // }
            // {
            //   name: 'cube-super-recommended',
            //   type: TableButtonType.ROW,
            //   label: '引力魔方+超级推荐',
            //   icon: 'el-icon-edit'
            // }, {
            //   name: 'new-gift',
            //   type: TableButtonType.ROW,
            //   label: '上新礼',
            //   icon: 'el-icon-edit'
            // }

            // {
            //   handler: 'remove',
            //   name: 'remove',
            //   type: TableButtonType.ROW,
            //   label: '删除',
            //   buttonType: 'danger',
            //   icon: 'el-icon-delete'
            // }

          ])
          .build()
      },

      // {
      //   path: 'product-click-farm',
      //   component: () => import('@/feature/pdt/app/product-click-farm/index'),
      //   meta: {title: '商品刷单信息', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt:product-click-farm')
      //     .addButtons([
      //       {
      //         handler: 'list',
      //         type: TableButtonType.SEARCHBAR,
      //         label: '搜索',
      //         icon: 'el-icon-search'
      //       },
      //       {
      //         handler: 'export',
      //         type: TableButtonType.TOOLBAR_RIGHT,
      //         label: '导出',
      //         buttonType: 'primary',
      //         icon: 'el-icon-download'
      //       },
      //       {
      //         handler: 'create',
      //         type: TableButtonType.TOOLBAR,
      //         label: '新建商品刷单信息',
      //         icon: 'el-icon-plus'
      //       },
      //       {
      //         handler: 'import',
      //         type: TableButtonType.TOOLBAR,
      //         label: '导入',
      //         buttonType: 'danger',
      //         icon: 'el-icon-download'
      //       },
      //       {
      //         handler: 'update',
      //         type: TableButtonType.ROW,
      //         label: '修改',
      //         icon: 'el-icon-edit'
      //       },
      //       {
      //         handler: 'remove',
      //         type: TableButtonType.ROW,
      //         label: '删除',
      //         buttonType: 'danger',
      //         icon: 'el-icon-delete'
      //       }
      //
      //     ])
      //     .build()
      // }
      // ,
      // {
      //   path: 'product-new-date',
      //   component: () => import('@/feature/pdt/app/product-new-date/index'),
      //   meta: {title: '商品上新日期', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('pdt:product-new-date')
      //     .addButtons([
      //       {
      //         handler: 'list',
      //         type: TableButtonType.SEARCHBAR,
      //         label: '搜索',
      //         icon: 'el-icon-search'
      //       },
      //       {
      //         handler: 'export',
      //         type: TableButtonType.TOOLBAR_RIGHT,
      //         label: '导出',
      //         buttonType: 'primary',
      //         icon: 'el-icon-download'
      //       },
      //       {
      //         handler: 'create',
      //         type: TableButtonType.TOOLBAR,
      //         label: '新建商品上新日期',
      //         icon: 'el-icon-plus'
      //       },
      //       {
      //         handler: 'import',
      //         type: TableButtonType.TOOLBAR,
      //         label: '导入',
      //         buttonType: 'danger',
      //         icon: 'el-icon-download'
      //       },
      //       {
      //         handler: 'update',
      //         type: TableButtonType.ROW,
      //         label: '修改',
      //         icon: 'el-icon-edit'
      //       },
      //       {
      //         handler: 'remove',
      //         type: TableButtonType.ROW,
      //         label: '删除',
      //         buttonType: 'danger',
      //         icon: 'el-icon-delete'
      //       }
      //
      //     ])
      //     .build()
      // },,
      {
        path: 'measure',
        component: () => import('@/feature/pdt/app/measure/index'),
        meta: { title: '尺码管理', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('pdt:measure')

          .addButtons([
            {
              handler: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建尺码',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }

          ])
          .build()
      },
      {
        path: 'competing-store-blogger',
        component: () => import('@/feature/mct/app/competing-store-blogger/index'),
        meta: { title: '竞店博主登记', icon: 'table', dataCount: 'competingStoreBlogger.count' },
        buttons: RouteButtonsBuilder.builder('mct:competing-store-blogger')
          .addButtons([
            {
              handler: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              name: 'export',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建',
              icon: 'el-icon-plus'
            },
            {
              handler: 'import',
              type: TableButtonType.TOOLBAR,
              label: '批量导入',
              buttonType: 'success',
              icon: 'el-icon-upload'
            },
            {
              handler: 'batch-remove',
              type: TableButtonType.TOOLBAR,
              label: '批量删除',
              name: 'remove',
              buttonType: 'danger',
              icon: 'el-icon-edit'
            }, {
              handler: 'clearAll',
              buttonType: 'danger',
              name: 'remove',
              type: TableButtonType.TOOLBAR,
              label: '批量清理',
              icon: 'el-icon-edit'
            },
            {
              handler: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }
          ])
          .build()
      },
      {
        path: 'competing-store-blogger-data',
        component: () => import('@/feature/mct/app/competing-store-blogger/data'),
        meta: { title: '竞店博主报表', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('mct:competing-store-blogger:data')
          .build()
      }
      // #appendSpot# 生成工具用，不要删了
    ]
  }
]
